<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibQQt: QCPItemAnchor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibQQt
   &#160;<span id="projectnumber">v3.1</span>
   </div>
   <div id="projectbrief">开源、跨平台Qt应用程序框架中间件</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="class_q_c_p_item_anchor-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QCPItemAnchor Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>An anchor of an item to which positions can be attached to.  
 <a href="class_q_c_p_item_anchor.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for QCPItemAnchor:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_q_c_p_item_anchor.png" usemap="#QCPItemAnchor_map" alt=""/>
  <map id="QCPItemAnchor_map" name="QCPItemAnchor_map">
<area href="class_q_c_p_item_position.html" title="Manages the position of an item. " alt="QCPItemPosition" shape="rect" coords="0,56,105,80"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aeb6b681d2bf324db40a915d32ec5624f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_item_anchor.html#aeb6b681d2bf324db40a915d32ec5624f">QCPItemAnchor</a> (<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *parentPlot, <a class="el" href="class_q_c_p_abstract_item.html">QCPAbstractItem</a> *parentItem, const QString name, int anchorId=-1)</td></tr>
<tr class="separator:aeb6b681d2bf324db40a915d32ec5624f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad37cdf5a3f63428f61be739014e212e"><td class="memItemLeft" align="right" valign="top"><a id="aad37cdf5a3f63428f61be739014e212e"></a>
QString&#160;</td><td class="memItemRight" valign="bottom"><b>name</b> () const</td></tr>
<tr class="separator:aad37cdf5a3f63428f61be739014e212e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1a21d9471d1d788624cad297e1b8d6f"><td class="memItemLeft" align="right" valign="top">virtual QPointF&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_item_anchor.html#ae1a21d9471d1d788624cad297e1b8d6f">pixelPoint</a> () const</td></tr>
<tr class="separator:ae1a21d9471d1d788624cad297e1b8d6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ac54b20120669950255a63587193dbb86"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_item_anchor.html#ac54b20120669950255a63587193dbb86">toQCPItemPosition</a> ()</td></tr>
<tr class="separator:ac54b20120669950255a63587193dbb86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef15daa640debfb11b0aeaa2116c6fbc"><td class="memItemLeft" align="right" valign="top"><a id="aef15daa640debfb11b0aeaa2116c6fbc"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>addChildX</b> (<a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> *pos)</td></tr>
<tr class="separator:aef15daa640debfb11b0aeaa2116c6fbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a230b1d494cda63458e289bbe1b642599"><td class="memItemLeft" align="right" valign="top"><a id="a230b1d494cda63458e289bbe1b642599"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>removeChildX</b> (<a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> *pos)</td></tr>
<tr class="separator:a230b1d494cda63458e289bbe1b642599"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af05dc56f24536f0c7a9a0f57b58cea67"><td class="memItemLeft" align="right" valign="top"><a id="af05dc56f24536f0c7a9a0f57b58cea67"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>addChildY</b> (<a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> *pos)</td></tr>
<tr class="separator:af05dc56f24536f0c7a9a0f57b58cea67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2394911d8fff3bd958b9f4f1994b64d"><td class="memItemLeft" align="right" valign="top"><a id="aa2394911d8fff3bd958b9f4f1994b64d"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>removeChildY</b> (<a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> *pos)</td></tr>
<tr class="separator:aa2394911d8fff3bd958b9f4f1994b64d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a23ad4d0ab0d2cbb41a7baf05bcf996ec"><td class="memItemLeft" align="right" valign="top"><a id="a23ad4d0ab0d2cbb41a7baf05bcf996ec"></a>
QString&#160;</td><td class="memItemRight" valign="bottom"><b>mName</b></td></tr>
<tr class="separator:a23ad4d0ab0d2cbb41a7baf05bcf996ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59b968410831ba91a25cc75a77dde6f5"><td class="memItemLeft" align="right" valign="top"><a id="a59b968410831ba91a25cc75a77dde6f5"></a>
<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>mParentPlot</b></td></tr>
<tr class="separator:a59b968410831ba91a25cc75a77dde6f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80fad480ad3bb980446ed6ebc00818ae"><td class="memItemLeft" align="right" valign="top"><a id="a80fad480ad3bb980446ed6ebc00818ae"></a>
<a class="el" href="class_q_c_p_abstract_item.html">QCPAbstractItem</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>mParentItem</b></td></tr>
<tr class="separator:a80fad480ad3bb980446ed6ebc00818ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00c62070333e8345976b579676ad3997"><td class="memItemLeft" align="right" valign="top"><a id="a00c62070333e8345976b579676ad3997"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>mAnchorId</b></td></tr>
<tr class="separator:a00c62070333e8345976b579676ad3997"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c0bfd6e50f3b48e2a9b3824695b20f7"><td class="memItemLeft" align="right" valign="top"><a id="a3c0bfd6e50f3b48e2a9b3824695b20f7"></a>
QSet&lt; <a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mChildrenX</b></td></tr>
<tr class="separator:a3c0bfd6e50f3b48e2a9b3824695b20f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3abe4eebd0683454d81c8341df6f7115"><td class="memItemLeft" align="right" valign="top"><a id="a3abe4eebd0683454d81c8341df6f7115"></a>
QSet&lt; <a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mChildrenY</b></td></tr>
<tr class="separator:a3abe4eebd0683454d81c8341df6f7115"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:aa9b8ddc062778e202a0be06a57d18d17"><td class="memItemLeft" align="right" valign="top"><a id="aa9b8ddc062778e202a0be06a57d18d17"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>QCPItemPosition</b></td></tr>
<tr class="separator:aa9b8ddc062778e202a0be06a57d18d17"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An anchor of an item to which positions can be attached to. </p>
<p>An item (<a class="el" href="class_q_c_p_abstract_item.html" title="The abstract base class for all items in a plot. ">QCPAbstractItem</a>) may have one or more anchors. Unlike <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a>, an anchor doesn't control anything on its item, but provides a way to tie other items via their positions to the anchor.</p>
<p>For example, a <a class="el" href="class_q_c_p_item_rect.html" title="A rectangle. ">QCPItemRect</a> is defined by its positions <em>topLeft</em> and <em>bottomRight</em>. Additionally it has various anchors like <em>top</em>, <em>topRight</em> or <em>bottomLeft</em> etc. So you can attach the <em>start</em> (which is a <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a>) of a <a class="el" href="class_q_c_p_item_line.html" title="A line from one point to another. ">QCPItemLine</a> to one of the anchors by calling <a class="el" href="class_q_c_p_item_position.html#ac094d67a95d2dceafa0d50b9db3a7e51">QCPItemPosition::setParentAnchor</a> on <em>start</em>, passing the wanted anchor of the <a class="el" href="class_q_c_p_item_rect.html" title="A rectangle. ">QCPItemRect</a>. This way the start of the line will now always follow the respective anchor location on the rect item.</p>
<p>Note that <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> derives from <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a>, so every position can also serve as an anchor to other positions.</p>
<p>To learn how to provide anchors in your own item subclasses, see the subclassing section of the <a class="el" href="class_q_c_p_abstract_item.html" title="The abstract base class for all items in a plot. ">QCPAbstractItem</a> documentation. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aeb6b681d2bf324db40a915d32ec5624f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb6b681d2bf324db40a915d32ec5624f">&#9670;&nbsp;</a></span>QCPItemAnchor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QCPItemAnchor::QCPItemAnchor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td>
          <td class="paramname"><em>parentPlot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_q_c_p_abstract_item.html">QCPAbstractItem</a> *&#160;</td>
          <td class="paramname"><em>parentItem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>anchorId</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a new <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a>. You shouldn't create <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a> instances directly, even if you want to make a new item subclass. Use QCPAbstractItem::createAnchor instead, as explained in the subclassing section of the <a class="el" href="class_q_c_p_abstract_item.html" title="The abstract base class for all items in a plot. ">QCPAbstractItem</a> documentation. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ae1a21d9471d1d788624cad297e1b8d6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1a21d9471d1d788624cad297e1b8d6f">&#9670;&nbsp;</a></span>pixelPoint()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QPointF QCPItemAnchor::pixelPoint </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the final absolute pixel position of the <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a> on the <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> surface.</p>
<p>The pixel information is internally retrieved via QCPAbstractItem::anchorPixelPosition of the parent item, <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a> is just an intermediary. </p>

<p>Reimplemented in <a class="el" href="class_q_c_p_item_position.html#a6cad070c22801295231f5bd6045afe70">QCPItemPosition</a>.</p>

</div>
</div>
<a id="ac54b20120669950255a63587193dbb86"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac54b20120669950255a63587193dbb86">&#9670;&nbsp;</a></span>toQCPItemPosition()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_q_c_p_item_position.html">QCPItemPosition</a> * QCPItemAnchor::toQCPItemPosition </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns 0 if this instance is merely a <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a>, and a valid pointer of type QCPItemPosition* if it actually is a <a class="el" href="class_q_c_p_item_position.html" title="Manages the position of an item. ">QCPItemPosition</a> (which is a subclass of <a class="el" href="class_q_c_p_item_anchor.html" title="An anchor of an item to which positions can be attached to. ">QCPItemAnchor</a>).</p>
<p>This safe downcast functionality could also be achieved with a dynamic_cast. However, <a class="el" href="class_q_custom_plot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> avoids dynamic_cast to work with projects that don't have RTTI support enabled (e.g. -fno-rtti flag with gcc compiler). </p>

<p>Reimplemented in <a class="el" href="class_q_c_p_item_position.html#a577a7efc601df85a20b3e709d1ac320e">QCPItemPosition</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>R:/Develop/a0-develop/LibQQt/src/charts/qcustomplot/<a class="el" href="qcustomplot_8h_source.html">qcustomplot.h</a></li>
<li>R:/Develop/a0-develop/LibQQt/src/charts/qcustomplot/<a class="el" href="qcustomplot_8cpp.html">qcustomplot.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
